<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>百度</title>
	<script type="text/javascript" src="MyAjax.js"></script>
	<script type="text/javascript">
		window.onload = function(){
			var btn = document.querySelector("#btn");
			btn.onclick = function(){
				var keywordValue = document.querySelector("#keyword").value;
				console.log(keywordValue);
			myAjax({
				url:"https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su",
				data:{wd:keywordValue},
				jsonp:"cb",
			    jsonpCallback:"zxm",
				success:function(data){
						var liTag = "";
						for(var i=0;i< data.s.length;i++){
							var temp = data.s[i];
							
							liTag +="<li>"+temp+"</li>";
						}
						var ul = document.querySelector('ul');
						ul.innerHTML = liTag;
					}	
				});
 
			};

		};

	</script>  
</head>
<body>
	<input type="text" id="keyword" placeholder="请输入关键字">
	<input type="button" id="btn" value="搜索">
	<ul>
	</ul>
	
</body>
</html>